package com.mycompany.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mycompany.entity.Mom;
import com.mycompany.repository.MomDao;
import com.mycompany.service.MomService;

@Service
public class MomServiceImpl implements MomService {
	
	@Autowired
	private MomDao momDao;


	@Override
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void save(Mom mom) {
		momDao.persist(mom);
	}


	@Override
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void update(Mom mom) {
		momDao.merge(mom);
	}


	@Override
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void delete(Mom mom) {
		momDao.remove(mom);
		
	}

	@Override
	public Mom getMom(Integer momId) {
		// TODO Auto-generated method stub
		return momDao.getMom(momId);
	}

	@Override
	public List<Mom> getAllMom() {
		// TODO Auto-generated method stub
		return momDao.getAllMom();
	}
	
	@Override
    public List<Mom> getAllMomRound() {
        // TODO Auto-generated method stub
        return momDao.getAllMomRound();
    }


    @Override
    public Mom getMom(Mom mom) {
        // TODO Auto-generated method stub
        return momDao.getMom(mom);
    }
    
    @Override
    public String getTotlePriceRound()
    {
        return momDao.getTotlePriceRound();
    }

}
